// custom-tab-bar/index.js
Component({
        options:{
            styleIsolation:"shared"
        },
    /**
     * 组件的属性列表
     */
    
    properties: {

    },

    /**
     * 组件的初始数据
     */
    data: {
        active:0,
        "list": [{
            "pagePath": "pages/index/index",
            "text": "首页",
            "icon":"https://img.yzcdn.cn/vant/user-inactive.png",
            "selectIcon":"https://img.yzcdn.cn/vant/user-active.png",
            "info":20
          }, {
            "pagePath": "pages/message/message",
            "text": "日志",
            "icon":"https://img.yzcdn.cn/vant/user-inactive.png",
            "selectIcon":"https://img.yzcdn.cn/vant/user-active.png"
          }],
    },

    /**
     * 组件的方法列表
     */
    methods: {
        onChange(event) {
            // event.detail 的值为当前选中项的索引
            this.setData({ active: event.detail });
            wx.switchTab({
              url: "/"+this.data.list[event.detail].pagePath,
            })
          }
    }
})
